package ru.onlinestore.mobile.ui.components

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import ru.onlinestore.mobile.ui.theme.gray
import ru.onlinestore.mobile.ui.theme.green
import ru.onlinestore.mobile.ui.theme.white

@Composable
fun ButtonCompose(
    title: String,
    onClick: () -> Unit,
    fontSize: TextUnit = 15.sp,
    enabled: Boolean = true
) {
    Button(
        onClick = onClick,
        content = {
            Text(
                text = title,
                style = TextStyle(
                    fontWeight = FontWeight.ExtraBold,
                    fontSize = fontSize
                )
            )
        },
        modifier = Modifier
            .fillMaxWidth()
            .height(56.dp),
        shape = RoundedCornerShape(12.dp),
        colors = ButtonColors(
            containerColor = green,
            contentColor = white,
            disabledContainerColor = gray,
            disabledContentColor = white
        ),
        enabled = enabled
    )
}